#include "GUI.h"
#include "DIALOG.h"
#include "BUTTON.h"
#include "led.h"
#include "bitmapdisplay.h"
#include <os.h>
#include "rtc.h"
#include "EmWinHZFont.h"
#include "xbffontcreate.h"
#include "xbffontdemo.h"
#include "dianzitushu.h"
//#include "buttonbmpdisp.h"
//////////////////////////////////////////////////////////////////////////////////	 
//±¾³ÌÐòÖ»¹©Ñ§Ï°Ê¹ÓÃ£¬Î´¾­×÷ÕßÐí¿É£¬²»µÃÓÃÓÚÆäËüÈÎºÎÓÃÍ¾
//ALIENTEK STM32F407¿ª·¢°å
//STemWin BUTTONÎ»Í¼ÏÔÊ¾
//ÕýµãÔ­×Ó@ALIENTEK
//¼¼ÊõÂÛÌ³:www.openedv.com
//´´½¨ÈÕÆÚ:2015/4/10
//°æ±¾£ºV1.0
//°æÈ¨ËùÓÐ£¬µÁ°æ±Ø¾¿¡£
//Copyright(C) ¹ãÖÝÊÐÐÇÒíµç×Ó¿Æ¼¼ÓÐÏÞ¹«Ë¾ 2014-2024
//All rights reserved					

//流动场
////////////////////////////////////////////////////////////////////////////////// 	

#include "DIALOG.h"

/*********************************************************************
*
*       Defines
*
**********************************************************************
*/
#define ID_FRAMEWIN_0     (GUI_ID_USER + 0x00)
#define ID_BUTTON_0     (GUI_ID_USER + 0x01)
#define ID_BUTTON_1     (GUI_ID_USER + 0x02)
#define ID_BUTTON_2     (GUI_ID_USER + 0x03)
#define ID_BUTTON_3     (GUI_ID_USER + 0x04)
#define ID_BUTTON_4     (GUI_ID_USER + 0x05)
#define ID_BUTTON_5     (GUI_ID_USER + 0x06)
#define ID_BUTTON_6     (GUI_ID_USER + 0x07)
#define ID_BUTTON_7     (GUI_ID_USER + 0x08)
#define ID_BUTTON_8     (GUI_ID_USER + 0x09)
#define ID_BUTTON_9     (GUI_ID_USER + 0x0A)
#define ID_BUTTON_10     (GUI_ID_USER + 0x0B)
#define ID_BUTTON_11     (GUI_ID_USER + 0x0C)
#define ID_BUTTON_12     (GUI_ID_USER + 0x0D)
#define ID_BUTTON_13     (GUI_ID_USER + 0x0E)
#define ID_BUTTON_14     (GUI_ID_USER + 0x0F)
#define ID_BUTTON_15     (GUI_ID_USER + 0x10)
#define ID_BUTTON_16     (GUI_ID_USER + 0x11)
#define ID_TEXT_0 		(GUI_ID_USER +0x12 )
#define ID_TEXT_1 		(GUI_ID_USER +0x13 )
#define ID_TEXT_2 		(GUI_ID_USER +0x14 )
#define ID_TEXT_3 		(GUI_ID_USER +0x15 )
#define ID_TEXT_4 		(GUI_ID_USER +0x16 )
#define ID_TEXT_5 		(GUI_ID_USER +0x17 )
#define ID_TEXT_6 		(GUI_ID_USER +0x18 )
#define ID_TEXT_7 		(GUI_ID_USER +0x19 )
#define ID_TEXT_8 		(GUI_ID_USER +0x1a )
#define ID_TEXT_9 		(GUI_ID_USER +0x1b )
#define ID_TEXT_10 		(GUI_ID_USER +0x1c )
#define ID_TEXT_11 		(GUI_ID_USER +0x1d )
#define ID_TEXT_12 		(GUI_ID_USER +0x1e )
#define ID_TEXT_13 		(GUI_ID_USER +0x1f )
#define ID_TEXT_14 		(GUI_ID_USER +0x20 )
#define ID_TEXT_15 		(GUI_ID_USER +0x21 )
#define ID_TEXT_16 		(GUI_ID_USER +0x22 )

// USER START (Optionally insert additional defines)
// USER END

/*********************************************************************
*
*       Static data
*
**********************************************************************
*/

// USER START (Optionally insert additional static data)
// USER END

/*********************************************************************
*
*       _aDialogCreate
*/
static const GUI_WIDGET_CREATE_INFO _aDialogCreate[] = {
  { FRAMEWIN_CreateIndirect, "Framewin", ID_FRAMEWIN_0, 0, 0, 240, 320, 0, 0x64, 0 },
  { BUTTON_CreateIndirect, "Button", ID_BUTTON_0, 10, 10, 47, 35, 0, 0x0, 0 },
  { BUTTON_CreateIndirect, "Button1", ID_BUTTON_1, 67, 10, 47, 35, 0, 0x0, 0 },
  { BUTTON_CreateIndirect, "Button2", ID_BUTTON_2, 124, 10, 47, 35, 0, 0x0, 0 },
  { BUTTON_CreateIndirect, "Button3", ID_BUTTON_3, 181, 10, 47, 35, 0, 0x0, 0 },
  { BUTTON_CreateIndirect, "Button4", ID_BUTTON_4, 10, 55, 47, 35, 0, 0x0, 0 },
  { BUTTON_CreateIndirect, "Button5", ID_BUTTON_5, 67, 55, 47, 35, 0, 0x0, 0 },
  { BUTTON_CreateIndirect, "Button6", ID_BUTTON_6, 124, 55, 47, 35, 0, 0x0, 0 },
  { BUTTON_CreateIndirect, "Button7", ID_BUTTON_7, 181, 55, 47, 35, 0, 0x0, 0 },
  { BUTTON_CreateIndirect, "Button8", ID_BUTTON_8, 10, 100, 47, 35, 0, 0x0, 0 },
  { BUTTON_CreateIndirect, "Button9", ID_BUTTON_9, 67, 100, 47, 35, 0, 0x0, 0 },
  { BUTTON_CreateIndirect, "Button10", ID_BUTTON_10, 124, 100, 47, 35, 0, 0x0, 0 },
  { BUTTON_CreateIndirect, "Button11", ID_BUTTON_11, 181, 100, 47, 35, 0, 0x0, 0 },
  { BUTTON_CreateIndirect, "Button12", ID_BUTTON_12, 10, 145, 47, 35, 0, 0x0, 0 },
  { BUTTON_CreateIndirect, "Button13", ID_BUTTON_13, 67, 145, 47, 35, 0, 0x0, 0 },
  { BUTTON_CreateIndirect, "Button14", ID_BUTTON_14, 20, 245, 47, 35, 0, 0x0, 0 },
  { BUTTON_CreateIndirect, "Button15", ID_BUTTON_15, 97, 245, 47, 35, 0, 0x0, 0 },
  { BUTTON_CreateIndirect, "Button16", ID_BUTTON_16, 174, 245, 47, 35, 0, 0x0, 0 },
	 { TEXT_CreateIndirect, 		"Text0", 		ID_TEXT_0, 		25, 	45, 	30, 	10, 	0, 0x64, 0 },
	 { TEXT_CreateIndirect, 		"Text1", 		ID_TEXT_1, 		82, 	45, 	70, 	15, 	0, 0x64, 0 },
	 { TEXT_CreateIndirect, 		"Text2", 		ID_TEXT_2, 		139, 	45, 	70, 	15, 	0, 0x64, 0 },
	 { TEXT_CreateIndirect, 		"Text3", 		ID_TEXT_3, 		192, 	45, 	70, 	15, 	0, 0x64, 0 },
	 { TEXT_CreateIndirect, 		"Text4", 		ID_TEXT_4, 		25, 	90, 	70, 	15, 	0, 0x64, 0 },
	 { TEXT_CreateIndirect, 		"Text5", 		ID_TEXT_5, 		82, 	90, 	70, 	15, 	0, 0x64, 0 },
	 { TEXT_CreateIndirect, 		"Text6", 		ID_TEXT_6, 		139, 	90, 	70, 	15, 	0, 0x64, 0 },
	 { TEXT_CreateIndirect, 		"Text7", 		ID_TEXT_7, 		192, 	90, 	70, 	15, 	0, 0x64, 0 },
	 	 { TEXT_CreateIndirect, 		"Text8", 		ID_TEXT_8, 		25, 	135, 	30, 	10, 	0, 0x64, 0 },
	 { TEXT_CreateIndirect, 		"Text9", 		ID_TEXT_9, 		82, 	135, 	70, 	15, 	0, 0x64, 0 },
	 { TEXT_CreateIndirect, 		"Text10", 		ID_TEXT_10, 		139, 	135, 	70, 	15, 	0, 0x64, 0 },
	 { TEXT_CreateIndirect, 		"Text11", 		ID_TEXT_11, 		192, 	135, 	70, 	15, 	0, 0x64, 0 },
	 { TEXT_CreateIndirect, 		"Text12", 		ID_TEXT_12, 		25, 	180, 	70, 	15, 	0, 0x64, 0 },
	 { TEXT_CreateIndirect, 		"Text13", 		ID_TEXT_13, 		82, 	180, 	70, 	15, 	0, 0x64, 0 },
	 { TEXT_CreateIndirect, 		"Text14", 		ID_TEXT_14, 		35, 	280, 	70, 	15, 	0, 0x64, 0 },
	 { TEXT_CreateIndirect, 		"Text15", 		ID_TEXT_15, 		112, 	280, 	70, 	15, 	0, 0x64, 0 },
	  { TEXT_CreateIndirect, 		"Text16", 		ID_TEXT_16, 		189, 	280, 	70, 	15, 	0, 0x64, 0 },
  // USER START (Optionally insert additional widgets)
  // USER END
};

/*********************************************************************
*
*       Static code
*
**********************************************************************
*/

// USER START (Optionally insert additional static code)
// USER END

/*********************************************************************
*
*       _cbDialog
*/
static void _cbDialog(WM_MESSAGE * pMsg) {
  WM_HWIN hItem;
  int     NCode;
  int     Id;
	u32 cnt=31;
//	char* emwinversion;		
  // USER START (Optionally insert additional variables)
  // USER END

  switch (pMsg->MsgId) {
  case WM_INIT_DIALOG:
    //
    // Initialization of 'Framewin'
    //
    hItem = pMsg->hWin;
    FRAMEWIN_SetFont(hItem, &GUI_Font16_ASCII);
    FRAMEWIN_SetTitleHeight(hItem, 20);
    FRAMEWIN_SetText(hItem, "CPU");
		
	

	
    FRAMEWIN_SetTextColor(hItem, 0x00000000);
	
	hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_0);
	BUTTON_SetBitmapEx(hItem,0,&bmxiangce,0,0);
	BUTTON_SetText(hItem, "");
	hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_1);
	BUTTON_SetBitmapEx(hItem,0,&bmshipin,0,0);
	BUTTON_SetText(hItem, "");
	hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_2);
	BUTTON_SetBitmapEx(hItem,0,&bmyineyue,0,0);
	BUTTON_SetText(hItem, "");
	hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_3);
	BUTTON_SetBitmapEx(hItem,0,&bmjisuanqi,0,0);
	BUTTON_SetText(hItem, "");
	hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_4);
	BUTTON_SetBitmapEx(hItem,0,&bmshu,0,0);
	BUTTON_SetText(hItem, "");
	
	hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_5);
	BUTTON_SetBitmapEx(hItem,0,&bmcamera,0,0);
	BUTTON_SetText(hItem, "");
	
	hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_6);
	BUTTON_SetBitmapEx(hItem,0,&bmclock,0,0);
	BUTTON_SetText(hItem, "");
	hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_7);
	BUTTON_SetBitmapEx(hItem,0,&bmrili,0,0);
	BUTTON_SetText(hItem, "");
	hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_8);
	BUTTON_SetBitmapEx(hItem,0,&bmsousuo,0,0);
	BUTTON_SetText(hItem, "");
	hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_9);
	BUTTON_SetBitmapEx(hItem,0,&bmluyin,0,0);
	BUTTON_SetText(hItem, "");
	hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_10);
	BUTTON_SetBitmapEx(hItem,0,&bmshezhi,0,0);
	BUTTON_SetText(hItem, "");
	hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_11);
	BUTTON_SetBitmapEx(hItem,0,&bmyouxiji,0,0);
	BUTTON_SetText(hItem, "");
	hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_12);
	BUTTON_SetBitmapEx(hItem,0,&bmusb,0,0);
	BUTTON_SetText(hItem, "");
	hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_13);
	BUTTON_SetBitmapEx(hItem,0,&bmWUXIAN,0,0);
	BUTTON_SetText(hItem, "");
		hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_14);
	BUTTON_SetBitmapEx(hItem,0,&bmdianhua,0,0);
	BUTTON_SetText(hItem, "");
	hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_15);
	BUTTON_SetBitmapEx(hItem,0,&bmduanxin,0,0);
	BUTTON_SetText(hItem, "");
	hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_16);
	BUTTON_SetBitmapEx(hItem,0,&bmsousuo,0,0);
	BUTTON_SetText(hItem, "");
	
	
	
		hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_0);
			TEXT_SetFont(hItem,&XBF6_Font);
			TEXT_SetTextColor(hItem,GUI_BLUE);
			TEXT_SetText(hItem,"相册 ");	
				hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_1);
			TEXT_SetFont(hItem,&XBF6_Font);
			TEXT_SetTextColor(hItem,GUI_BLUE);
			TEXT_SetText(hItem,"视频 ");	
				hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_2);
			TEXT_SetFont(hItem,&XBF6_Font);
			TEXT_SetTextColor(hItem,GUI_BLUE);
			TEXT_SetText(hItem,"音乐 ");	
				hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_3);
			TEXT_SetFont(hItem,&XBF6_Font);
			TEXT_SetTextColor(hItem,GUI_BLUE);
			TEXT_SetText(hItem,"计算器 ");	
					hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_4);
			TEXT_SetFont(hItem,&XBF6_Font);
			TEXT_SetTextColor(hItem,GUI_BLUE);
			TEXT_SetText(hItem,"图书 ");	
				hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_5);
			TEXT_SetFont(hItem,&XBF6_Font);
			TEXT_SetTextColor(hItem,GUI_BLUE);
			TEXT_SetText(hItem,"相机 ");	
				hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_6);
			TEXT_SetFont(hItem,&XBF6_Font);
			TEXT_SetTextColor(hItem,GUI_BLUE);
			TEXT_SetText(hItem,"时钟 ");	
				hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_7);
			TEXT_SetFont(hItem,&XBF6_Font);
			TEXT_SetTextColor(hItem,GUI_BLUE);
			TEXT_SetText(hItem,"日历 ");	
	   	hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_8);
			TEXT_SetFont(hItem,&XBF6_Font);
			TEXT_SetTextColor(hItem,GUI_BLUE);
			TEXT_SetText(hItem,"搜索 ");	
				hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_9);
			TEXT_SetFont(hItem,&XBF6_Font);
			TEXT_SetTextColor(hItem,GUI_BLUE);
			TEXT_SetText(hItem,"录音 ");	
				hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_10);
			TEXT_SetFont(hItem,&XBF6_Font);
			TEXT_SetTextColor(hItem,GUI_BLUE);
			TEXT_SetText(hItem,"设置 ");	
				hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_11);
			TEXT_SetFont(hItem,&XBF6_Font);
			TEXT_SetTextColor(hItem,GUI_BLUE);
			TEXT_SetText(hItem,"游戏机 ");
					hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_12);
			TEXT_SetFont(hItem,&XBF6_Font);
			TEXT_SetTextColor(hItem,GUI_BLUE);
			TEXT_SetText(hItem,"USB ");	
				hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_13);
			TEXT_SetFont(hItem,&XBF6_Font);
			TEXT_SetTextColor(hItem,GUI_BLUE);
			TEXT_SetText(hItem,"无线 ");
						hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_14);
			TEXT_SetFont(hItem,&XBF6_Font);
			TEXT_SetTextColor(hItem,GUI_BLUE);
			TEXT_SetText(hItem,"拨号 ");
						hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_15);
			TEXT_SetFont(hItem,&XBF6_Font);
			TEXT_SetTextColor(hItem,GUI_BLUE);
			TEXT_SetText(hItem,"短信 ");
						hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_16);
			TEXT_SetFont(hItem,&XBF6_Font);
			TEXT_SetTextColor(hItem,GUI_BLUE);
			TEXT_SetText(hItem,"搜索 ");
    // USER START (Optionally insert additional code for further widget initialization)
    // USER END
    break;
  case WM_NOTIFY_PARENT:
    Id    = WM_GetId(pMsg->hWinSrc);
    NCode = pMsg->Data.v;
    switch(Id) {
    case ID_BUTTON_0: // Notifications sent by 'Button'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
				LED0=!LED0;
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
    case ID_BUTTON_1: // Notifications sent by 'Button1'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
				LED1=!LED1;
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
    case ID_BUTTON_2: // Notifications sent by 'Button2'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
    case ID_BUTTON_3: // Notifications sent by 'Button3'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
    case ID_BUTTON_4: // Notifications sent by 'Button4'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
            //电子图书
			    	LED1=!LED1;
		       	dianzitushu_Demo();
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
    case ID_BUTTON_5: // Notifications sent by 'Button5'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
    case ID_BUTTON_6: // Notifications sent by 'Button6'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
    case ID_BUTTON_7: // Notifications sent by 'Button7'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
    case ID_BUTTON_8: // Notifications sent by 'Button8'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
    case ID_BUTTON_9: // Notifications sent by 'Button9'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
    case ID_BUTTON_10: // Notifications sent by 'Button10'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
    case ID_BUTTON_11: // Notifications sent by 'Button11'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
    case ID_BUTTON_12: // Notifications sent by 'Button12'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
    case ID_BUTTON_13: // Notifications sent by 'Button13'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
    case ID_BUTTON_14: // Notifications sent by 'Button14'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
    case ID_BUTTON_15: // Notifications sent by 'Button15'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
    case ID_BUTTON_16: // Notifications sent by 'Button16'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
    // USER START (Optionally insert additional code for further Ids)
    // USER END
    }
    break;
  // USER START (Optionally insert additional message handling)
  // USER END
  default:
    WM_DefaultProc(pMsg);
    break;
  }
}


//´´½¨Ò»¸ö¶Ô»°¿ò
WM_HWIN CreateFramewin(void) 
{
	WM_HWIN hWin;
//buttonbmp_tab[0]=bmBUTTONOFF;
//buttonbmp_tab[1]=bmBUTTONON;
	hWin = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, WM_HBKWIN, 0, 0);
	return hWin;
}
void getcpu()
{
  	u8 m;
	 m=OSStatTaskCPUUsage/100;
	//	GUI_GotoXY(0,10);
//	GUI_SetTextMode(GUI_TM_TRANS);
	GUI_SetFont(&GUI_Font16_ASCII);
	GUI_SetColor(GUI_RED);

		GUI_DispDecAt(m,40,4,3);
}
void gettime()
{
  RTC_TimeTypeDef RTC_TimeStruct;
//	RTC_DateTypeDef RTC_DateStruct;
	u8 hour;
	u8 miao;
	RTC_GetTime(RTC_Format_BIN,&RTC_TimeStruct);
	 hour=RTC_TimeStruct.RTC_Hours;
	miao=RTC_TimeStruct.RTC_Minutes;
	GUI_SetFont(&GUI_Font16_ASCII);
	GUI_SetColor(GUI_BLUE);

		GUI_DispDecAt(hour,200,4,2);
	GUI_DispDecAt(miao,220,4,2);
  
}
//BUTTON°´Å¥ÉÏÏÔÊ¾Î»Í¼
void Buttonbmp_Demo(void)
{
	
	WM_HWIN hWin;
	
	
	BUTTON_SetDefaultSkin(BUTTON_SKIN_FLEX); 
	CHECKBOX_SetDefaultSkin(CHECKBOX_SKIN_FLEX);
	DROPDOWN_SetDefaultSkin(DROPDOWN_SKIN_FLEX);
	FRAMEWIN_SetDefaultSkin(FRAMEWIN_SKIN_FLEX);
	HEADER_SetDefaultSkin(HEADER_SKIN_FLEX);
	MENU_SetDefaultSkin(MENU_SKIN_FLEX);
	MULTIPAGE_SetDefaultSkin(MULTIPAGE_SKIN_FLEX);
	PROGBAR_SetDefaultSkin(PROGBAR_SKIN_FLEX);
	RADIO_SetDefaultSkin(RADIO_SKIN_FLEX);
	SCROLLBAR_SetDefaultSkin(SCROLLBAR_SKIN_FLEX);
	SLIDER_SetDefaultSkin(SLIDER_SKIN_FLEX);
	SPINBOX_SetDefaultSkin(SPINBOX_SKIN_FLEX); 
	
	hWin=CreateFramewin();
	while(1)
	{
	  getcpu();
		gettime();
		
	

		GUI_Delay(100);
	}
}

